package easycloud.ecs.provider.baidu.model;

import java.util.ArrayList;
import java.util.List;

import com.baidu.inf.iis.bcs.model.ObjectListing;
import com.baidu.inf.iis.bcs.model.ObjectSummary;

import easycloud.ecs.api.model.IStorageObjectListing;
import easycloud.ecs.api.model.IStorageObjectSummary;

public class BaiduStorageObjectListing implements IStorageObjectListing {

	private ObjectListing objectList;

	public BaiduStorageObjectListing(ObjectListing objectList) {
		this.objectList = objectList;
	}

	@Override
	public List<IStorageObjectSummary> getObjectSummaries() {
		List<IStorageObjectSummary> result = new ArrayList<IStorageObjectSummary>();
		List<ObjectSummary> adapterResult = objectList.getObjectSummaries();
		for (ObjectSummary summary : adapterResult) {
			result.add(new BaiduStorageObjectSummary(summary));
		}
		return result;
	}

}
